package harvard.cscie160.hw7.project;
import java.util.HashMap;

/**
 * Class maintains basic security information for accounts
 * @author M Bret Blackford
 *
 */
public class SecurityInfo {
	
	private String PIN;
	private final HashMap<OperationEnumType, Boolean> permissions;

	public SecurityInfo() {
		permissions = new HashMap<OperationEnumType, Boolean>();
	}

	public String getPIN() {
		return PIN;
	}

	public void setPIN(String _PIN) {
		this.PIN = _PIN;
	}

	public void setAccess(OperationEnumType enumType, boolean access) {
		permissions.put(enumType, access);
	}

	public boolean getAccess(OperationEnumType type) {
		
		Boolean isAccessOk = permissions.get(type);

		if (isAccessOk == null) {
			isAccessOk = true;
		}

		return isAccessOk;
	}
}

